<%@ page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<title>表单应用</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/pages/styles/styles.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/scripts/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/ext/ext-all.js"></script>
<script src="<%=request.getContextPath()%>/scripts/jquery/jquery.min.js"	language="javascript"></script>
<style type="text/css">
.logo {
	font-size: 28px;
	font-family: "华文楷体";
	text-decoration: none;
	color: white;
	font-weight: bold;
}
.logo-bar {
	padding-top: 0px;
}
.x-bar {
	font-weight: bold;
	color: #FFF;
}
.x-bar2 {
	font-weight: bold;
	color: #FFF;
	cursor: pointer;
}
</style>
<script language="javascript">

/**
 * 加载待办任务列表
 */
function loadTodoTaskList(link){
	loadDataById('todo_taskList',link);
}
/**
 * 加载公文正文
 */
function loadDocBody(link){
	loadDataById('doc_body',link);
}
/**
 * 加载右边的公文详细Panel
 */
function loadContentPanel(link){
	loadDataById('contentPanel',link);
}
/**
 * 根据ID和link加载数据的共用方法
 */
function loadDataById(divId, link){
	$('#'+divId).load(link);
}
/**
 * 点击某个公文，加载正文、附件以及详细显示
 */
function loadDocData(docId){
	loadDocBody('doc_body.jsp?docId='+docId);
	loadDocAttach('doc_attach.jsp?docId='+docId);
	loadContentPanel('content.jsp?docId='+docId);
}
//load doc attach
function loadDocAttach(link){
	loadDataById('doc_attach',link);
}
//reload the task task
function reloadTodoTaskList(){
	loadTodoTaskList('todo_taskList.jsp?f=1');
}

</script>
<script type="text/javascript">
	//待办任务工具栏
	var todo_toolbar = "待办任务&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:reloadTodoTaskList();'>刷新列表</a>";
	//公文正文工具栏
	var docBody_toolbar = "<div style='float:left;'>公文正文</div>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/upload.gif' border=0 style='cursor:pointer;' onclick='alert(\"上传正文\");' alt='上传正文'/>";
	//公文附件工具栏
	var docAttach_toolbar = "<div style='float:left;'>公文附件</div>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/upload.gif' border=0 style='cursor:pointer;' onclick='alert(\"上传附件\");' alt='上传附件'/>";
	//操作公文工具栏
	var docAction_toolbar = "<img src='images/todo_save.gif' border=0 onclick='alert(\"save\");' style='cursor:pointer'/>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/todo_send.gif' border=0 onclick='alert(\"send\");' style='cursor:pointer'/>&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/todo_print.gif' border=0 onclick='alert(\"print\");' style='cursor:pointer'/>";
    Ext.onReady(function(){
        Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
        
       var viewport = new Ext.Viewport({
            layout:'border',
            items:[
                new Ext.BoxComponent({
                    region:'north',
                    el: 'north',
					hidden:true
                }),{
                    region:'west',
                    id:'west-panel',
                    title:todo_toolbar,
                    split:true,
                    width: 200,
                    minSize: 175,
                    maxSize: 300,
                    collapsible: true,
                    margins:'0 0 0 5',
                    layoutConfig:{
                        animate:false
                    },
                    items: [{
                        contentEl: 'todo_taskList',
                        title:'任务列表',
                        border:false,
						height:250,
						autoScroll:true
                       },{
					    //autoLoad :'todo_edit.jsp',
                        contentEl: 'doc_body',
                        title:docBody_toolbar,
                        border:false,
						height:100,
						autoScroll:true
                       },{
                        contentEl: 'doc_attach',
                        title:docAttach_toolbar,
                        border:false,
						autoScroll:true
                       }]
				     },
                new Ext.FormPanel({
                    region:'center',
                    activeTab:0,
					collapsible: true,
                    items:[{
                        contentEl:'contentPanel',
                        title: docAction_toolbar,
						autoHeight:true,
						border:false,
                        autoScroll:true
                    }]
                })
             ]
        });  
    });
</script>
</head>
<body id="x-body" leftmargin="0" topmargin="0" marginheight="0"
	marginwidth="0">
<div id="north" class="logo-bar"></div>
<!-- 待办任务列表DIV -->
<div id="todo_taskList"></div>
<!-- 公文正文DIV -->
<div id="doc_body"></div>
<!-- 公文附件DIV -->
<div id="doc_attach"></div>
<!-- 公文右边的Panel的DIV -->
<div id="contentPanel" align="center">
<script language="javascript">
	//刚进去时加载任务列表
	loadDataById('todo_taskList','todo_taskList.jsp');
</script>
</div>
</body>
</html>
